package com.lagou.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.lagou.mapper.StudentMapper;
import com.lagou.pojo.Student;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

@Service
public class StudentService {

    @Resource
    private StudentMapper studentMapper;

    public List<Student> getList(Wrapper<Student> wrapper) {
        List<Student> list = studentMapper.selectList(wrapper);
        return list;
    }

    public Student add(Student student) {
        student.setCreateTime(new Date());
        studentMapper.insert(student);
        return student;
    }

}
